<?php
include_once '../data/database_dal.php';

class MasterbatchDAL extends DatabaseDAL
{
    function update($id, $rfqID, $plasticType, $meltFlow, $customerResin, $heatStability, $weatherStability, $lightFastness, $additionalFunction1, $additionalFunction2,
                    $contactRating, $inTime, $inUSer)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_masterbatch_update('". $id ."', '". $rfqID ."', '". $plasticType ."', '". $meltFlow ."', '". $customerResin ."', '". $heatStability ."', '". $weatherStability ."', '". $lightFastness ."', '". $additionalFunction1 ."',
                                                        '". $additionalFunction2 ."', '". $contactRating ."', '". $inTime ."', '". $inUSer ."')");
        $this->close();
        return $result;
    }

    function get($where)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_masterbatch_get(".'"'. $where .'"'.")");
        $this->close();
        return $result;
    }

    function getAll($orderBy)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_masterbatch_get(".'"'. $orderBy .'"'.")");
        $this->close();
        return $result;
    }

    function delete($id)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_masterbatch_delete('". $id ."')");
        $this->close();
        return $result;
    }
}
?>
